package autoorder.zsxmlv.action;

import autoorder.zsxmlv.service.WechatUserService;
import common.zsxmlv.vo.Result;
import common.zsxmlv.vo.Table;
import org.apache.commons.beanutils.PropertyUtilsBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: ZSXM
 * @Description:
 * @Company: QIDI
 * @Date: Create by 2018/9/3 20:01
 * @Version: 1.0
 * @Modify by:
 */
@Controller
@ResponseBody
@RequestMapping("/admin/auto_order/wechatuser")
public class WechatUserAction {

    @Resource
    private WechatUserService service;

    @RequestMapping("/list")
    public Table list() {
        return service.selectAllUser();
    }

    @RequestMapping("/setOrUnset")
    public Result setOrUnset(String openid,Integer flag) {
        return service.setOrUnsetUser(openid, flag);
    }

    @RequestMapping("/insertOrUpdate")
    public Result insertOrUpdate() throws Exception {
        return service.insertOrUpdate();
    }
}
